package creadorEscenarios;

import java.awt.Color;
import java.util.ArrayList;

public class Trazo extends Figura {
	
	int[] x,y;
	int n;
	
	public Trazo(){
		super(TipoFigura.Trazo);
		n=0;
		x=new int[100];
		y=new int[100];
		color=Color.BLACK;
	}
	
	public void setColor(Color c){
		color=c;
	}
	
	public void anadirPunto(int a, int b){
		if(n< x.length){
			x[n]=a;
			y[n]=b;
		}else{
			//redimensionar
			int[] aux1=new int[x.length*2];
			int[] aux2=new int[y.length*2];
			
			for(int i=0; i<x.length; i++){
				aux1[i]=x[i];
				aux2[i]=y[i];
			}
			x=aux1;
			y=aux2;
			x[n]=a;
			y[n]=b;
		}
		n++;
	}
	
	public int[] getX(){
		return x;
	}
	
	public int[] getY(){
		return y;
	}
	
	public int getN(){
		return n;
	}
	
	public Color getColor(){
		return color;
	}

}
